package J.算法.动态规划;

public class _剑指Offer10II青蛙跳台阶问题 {
    public int numWays(int n) {

        if (n<2){
            return 1;
        }

        int prev = 1;
        int cur =1;

        for (int i = 2; i < n+1 ; i++) {
            int temp = cur;
            cur = (cur+ prev) % 1000000007;
            prev = temp;
        }

        return cur;
    }
}
